package com.csj.picture.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.csj.picture.model.dto.user.UserQueryRequest;
import com.csj.picture.model.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.csj.picture.model.vo.UserloginVo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author Lenovo
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-01-17 16:28:36
*/
public interface UserService extends IService<User> {
    // 用户注册
    long userRegister(String userName,String userAccount, String userPassword, String checkPassword);
    // 用户登录
    User userLogin(String userAccount, String userPassword, HttpServletRequest request);
    // 用户注销
    boolean userLogout(HttpServletRequest request);

    // 获取当前登录用户
    User getLoginUser(HttpServletRequest request);

    // 脱敏
    UserloginVo getUserVO(User user);

    // 获取用户列表（脱敏）
    List<UserloginVo> getUserVOList(List<User> userList);

    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    /*
     * 加密密码
     * */
    String getencryptPassword(String password);
    /**
     * 是否为管理员
     *
     * @param user
     * @return
     */
    boolean isAdmin(User user);

}
